package com.softtown.modules.organization.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.softtown.common.validator.group.DefaultGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @version v1.0
 * @ProjectName: softtown-aioffice
 * @ClassName: CompOrgDeptDTO
 * @Description: 公司部门DTO层
 * @Author: fuming
 * @Date: 2019/6/4 17:32
 */
@Data
@ApiModel(value = "公司部门")
public class CompOrgDeptDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "部门id")
    private Long id;

    @ApiModelProperty(value = "公司id")
    private Long compId;

    @ApiModelProperty(value = "上级id")
    private Long pid;

    @ApiModelProperty(value = "部门名称",required = true)
    @NotBlank(message = "{company.departmentname.require}")
    private String name;

    @ApiModelProperty(value = "部门主管id")
    private Long emplId;

    @ApiModelProperty(value = "排序")
    @NotNull(message = "{company.sort.require}", groups = DefaultGroup.class)
    private String sort;

    @ApiModelProperty(value = "创建时间")
    private Date createDate;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "姓名")
    private String realName;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新者")
    private Long updater;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private Date updateDate;

    @ApiModelProperty(value = "更新时间戳")
    private String updateTimestamp;

    @ApiModelProperty(value = "逻辑删除")
    private Integer isDeleted;

    @ApiModelProperty(value = "部门本身id")
    private Long deptId;

    @ApiModelProperty(value = "部门履历上级id")
    private Long departmentPid;

    @ApiModelProperty(value = "部门履历部门名称",required = true)
    @NotBlank(message = "company.departmentname.require")
    private String departmentName;

    @ApiModelProperty(value = "部门履历部门本身id")
    private Long departmentId;

    @ApiModelProperty(value = "上级部门名称")
    private String parentName;

    @ApiModelProperty(value = "部门名称(变更前）")
    private String nameOld;

    @ApiModelProperty(value = "部门名称(变更后）")
    private String nameNew;

    @ApiModelProperty(value = "上级id(变更前），一级部门为0")
    private Long pidOld;

    @ApiModelProperty(value = "上级id(变更后），一级部门为0")
    private Long pidNew;
}
